-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(NcCheckboxRadioSwitch): Pass attrs to input
if available
#5507
Conversation
/backport to next |
If not button type, pass the attrs to the input element to allow setting aria tags like `aria-invalid` and `aria-errormessage` Signed-off-by: Ferdinand Thiessen <[email protected]>
d3ea385
to
395fc5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't pass to the button as well?
They are as in this case it is the root element. |
we maybe should add consistent props for all input elements to have some focus and validation API independent of the implementation. |
// We need to pass attributes to the input element | ||
inheritAttrs: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are as in this case it is the root element.
But it is disabled via inheritAttrs: false
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For vue2 class and style are passed to the root as they are not attrs but somewhat special
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't pass to the button as well?
Here I meant the attrs, not only class/style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently there is a new possibility to pass attrs to input
, but the possibility to pass attrs to the button
has been disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So class & style are always set to the wrapper.
attrs
are passed to the wrapper (the button) for button type and to the input for other types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, missed this line.
Breaks server nextcloud/server#46239 |
The structure of components is private and can change anytime, thus assumptions about it will always be prone to break. This "regression" is only about tests that assume some specific internal structure, but it is more a fix. If you currently have |
☑️ Resolves
I would expect the attrs on the input element to allow any aria attributes.
So if not button type, pass the attrs to the input element to allow setting aria tags like
aria-invalid
andaria-errormessage
🏁 Checklist
next
requested with a Vue 3 upgrade